package com.lvhx.springboot.springbatch.sharedata;

import com.lvhx.springboot.entity.User;
import com.lvhx.springboot.springbatch.readfile.People;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;

/**
 * @auther 吕宏旭
 * @date 2019/9/5 15:40
 */
public class GetDataHolderTasklet implements Tasklet {

    ImportMetadataHolder importMetadataHolder;

    public void setImportMetadataHolder(ImportMetadataHolder importMetadataHolder) {
        this.importMetadataHolder = importMetadataHolder;
    }

    @Override
    public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
        User user = importMetadataHolder.getUser();

        System.out.println(user.toString());
        return RepeatStatus.FINISHED;
    }
}
